<?php
			$username=$_POST['username'];
			$password=$_POST['password'];
			$user_nickname=$_POST['user_nickname'];
			$sex=$_POST['sex'];
			$address=$_POST['address'];
			$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
			or die("无法连接到数据库");
			mysqli_query($db,"set names 'utf8'");
			$q="update tb_user set user_nickname='$user_nickname',sex='$sex',address='$address' where username='$username'";
			$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，返回结果我true或者false，将结果返回给$result
			if($result){
				echo "<script>alert('保存成功！');history.back()</script>";
			}
			mysqli_close($db);//断开与数据库的连接
			
			$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
			or die("无法连接到数据库");
			mysqli_query($db,"set names 'utf8'");
			$q="update tb_login set password='$password' where username='$username'";
			$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，返回结果我true或者false，将结果返回给$result
			if($result){
				echo "<script>alert('保存成功！');history.back()</script>";
			}
			mysqli_close($db);//断开与数据库的连接
?>